<?php

 function microtime_float()
{
		list($usec, $sec) = explode(" ", microtime());
		return ((float)$usec + (float)$sec);
}
function send_post($url) 
{  
    $context = array ();  
    $data = array ();
	$context ['http'] = array (   
		'timeout' => 60,    
		'method' => 'POST',    
		'content' => http_build_query( $data, '', '&' )   
	 );     
	$poststr="";
	$time_start =microtime_float();
	@file_get_contents ($url, false, stream_context_create ( $context ) ); 
	$time_end =microtime_float();
	$time = $time_end - $time_start;
	$time = ceil($time * 1000);
	foreach($http_response_header as $key=>$value){
		 $poststr.=$value;	
	} 
	if(strstr($poststr,"200 OK")){
		echo '{"code":"1","times":"'.$time.'","httpcode":"200"}';
	} else{
		echo '{"code":"0","times":"'.$time.'","httpcode":"0"}';	
	} 
}
$host=$_GET["host"];
send_post($host);
 
?>